#include<bits/stdc++.h>

using namespace std;
int cards[52];

//第12周高精度加法
int main() {
    int n;
    cin >> n;
    while (n--) {
        char suit;//花色
        int rank;//等级
        cin >> suit >> rank;//1-13
        rank--;//0-12
        if (suit == 'S')rank += 0;
        if (suit == 'H')rank += 13;
        if (suit == 'C')rank += 26;
        if (suit == 'D')rank += 39;
        cards[rank]++;

    }
    for (int i = 0; i < 52; i++) {
        if (cards[i] == 1)continue;
        if (i >= 39) {
            cout << "D " << i - 39 + 1 << endl;
        } else if (i >= 26) {
            cout << "C " << i - 26 + 1 << endl;
        } else if (i >= 13) {
            cout << "H " << i - 13 + 1 << endl;
        } else {
            cout << "S " << i + 1 << endl;
        }

    }
    return 0;
}
